import request from '@/utils/request'
import store from '@/store'
// 接口方法, 只负责调用一个接口, 返回一个Promise对象
// 获取频道数据接口
export const getSuggListAPI = ({ q }) => {
  return request({
    url: '/v1_0/suggestion',
    method: 'GET',
    headers: {
      Authorization: 'Bearer ' + store.state.user.token
    },
    params: { q }
  })
}

// 搜索页 - 获取搜索结果
export const getSearchResultListAPI = ({ keyword, page = 1 }) => {
  return request({
    url: '/v1_0/search',
    params: {
      q: keyword,
      page
    }
  })
}
